<?php
    header("Content-type: text/html; charset=utf-8");
    $localhost = 'localhost';
    $usernamesql = 'root';
    $passwordsql = 'root';
    $conn = mysqli_connect($localhost, $usernamesql, $passwordsql);
    //应用数据库
    $query='use bigmelon';
    mysqli_query($conn,$query);
   
    $tel=$_GET['tel'];
    $username=$_GET['username'];
    $telactive=$_GET['telactive'];
    $password=$_GET['password'];
    $query="select * from melon where tel='$tel'";
    $res=mysqli_query($conn,$query);
    $res=mysqli_fetch_array($res);
    
    if($res){
        die('0');//电话应景呗注册
    }else{
        $query="insert into melon (tel,username,password,tel_active) values ('$tel','$username','$password','$telactive')";
        mysqli_query($conn,$query);
        die('1');//注册成功
    }


?>